<link rel="stylesheet" type="text/css" href="${STATIC!}/xadmin/lib/layui/css/layui.css" />
<a
  href="javascript:void(0);"
  class="easyui-linkbutton"
  data-options="iconCls:'eova-icon724',plain:true"
  onclick="singleAdd()"
  >${button.name!'新增'}</a
>
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" onclick="singleAdd2()"
  >${button.name!'新增'}</button
>
<script type="text/javascript" src="${STATIC!}/xadmin/lib/layui/layui.all.js"></script>
<script type="text/javascript">
  var singleAdd = function () {
  	var $grid = $('#grid');
      loadDialog($grid, '${I18N(button.name)} ${object.name}', '/form/add/${object.code}', ${menu.config.params.width!'945'}, ${menu.config.params.height!'600'});
  };
  var singleAdd2 = function () {
      var index = layer.open({
        type: 2,
        title: '${I18N(button.name)} ${object.name}',
        content: '/form2/add/${object.code}',
        area: ['320px', '195px'],
        maxmin: true,
        yes: function(index, layero){
          //do something
          layer.close(index); //如果设定了yes回调，需进行手工关闭
        }
      });
      //弹出即全屏
      layer.full(index);
      window.singleAdd2Layer = index;
  };
</script>
